package com.czx.dagger2demo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import org.w3c.dom.Text;

import javax.inject.Inject;

public class Main2Activity extends AppCompatActivity {


    @Inject
    Poetry poetry;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        TextView textView = (TextView) findViewById(R.id.text);
        ActivityComponent.getInstance().inject(this);

        textView.setText(poetry.getPoem()+poetry.toString());
    }
}
